

//some 遍历数组如果至少有一项满足条件则为true，否则为false

Array.prototype.mySome=function(executor,thisArg=globalThis){
  //this判断
  if (this == null) return new TypeError('this is null or undefined')
  //回调函数判断类型判断
  if (typeof executor !== 'function') return new TypeError(executor + ' is no a function')

  for (let i = 0; i < this.length; i++) {
    if(executor.call(thisArg,this[i],i,this))return true
  }
  return false
}

let a=[
  {age:18},
  {age:19},
  {age:28},
  {age:8},
  {age:38},
  {age:8},
]

console.log(a.some(i=>i.age===29))
console.log(a.mySome(i=>i.age===29))
